package com.google.android.gms.internal;

import java.io.IOException;

public final class zzfmo extends zzflm<zzfmo> implements Cloneable {
    private String[] zzpyk = zzflv.EMPTY_STRING_ARRAY;
    private String[] zzpyl = zzflv.EMPTY_STRING_ARRAY;
    private int[] zzpym = zzflv.zzpvy;
    private long[] zzpyn = zzflv.zzpvz;
    private long[] zzpyo = zzflv.zzpvz;

    public zzfmo() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzddb */
    public zzfmo clone() {
        try {
            zzfmo zzfmo = (zzfmo) super.clone();
            if (this.zzpyk != null && this.zzpyk.length > 0) {
                zzfmo.zzpyk = (String[]) this.zzpyk.clone();
            }
            if (this.zzpyl != null && this.zzpyl.length > 0) {
                zzfmo.zzpyl = (String[]) this.zzpyl.clone();
            }
            if (this.zzpym != null && this.zzpym.length > 0) {
                zzfmo.zzpym = (int[]) this.zzpym.clone();
            }
            if (this.zzpyn != null && this.zzpyn.length > 0) {
                zzfmo.zzpyn = (long[]) this.zzpyn.clone();
            }
            if (this.zzpyo != null && this.zzpyo.length > 0) {
                zzfmo.zzpyo = (long[]) this.zzpyo.clone();
            }
            return zzfmo;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError(e);
        }
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof zzfmo)) {
            return false;
        }
        zzfmo zzfmo = (zzfmo) obj;
        if (zzflq.equals((Object[]) this.zzpyk, (Object[]) zzfmo.zzpyk) && zzflq.equals((Object[]) this.zzpyl, (Object[]) zzfmo.zzpyl) && zzflq.equals(this.zzpym, zzfmo.zzpym) && zzflq.equals(this.zzpyn, zzfmo.zzpyn) && zzflq.equals(this.zzpyo, zzfmo.zzpyo)) {
            return (this.zzpvl == null || this.zzpvl.isEmpty()) ? zzfmo.zzpvl == null || zzfmo.zzpvl.isEmpty() : this.zzpvl.equals(zzfmo.zzpvl);
        }
        return false;
    }

    public final int hashCode() {
        return ((((((((((((527 + getClass().getName().hashCode()) * 31) + zzflq.hashCode((Object[]) this.zzpyk)) * 31) + zzflq.hashCode((Object[]) this.zzpyl)) * 31) + zzflq.hashCode(this.zzpym)) * 31) + zzflq.hashCode(this.zzpyn)) * 31) + zzflq.hashCode(this.zzpyo)) * 31) + ((this.zzpvl == null || this.zzpvl.isEmpty()) ? 0 : this.zzpvl.hashCode());
    }

    public final /* synthetic */ zzfls zza(zzflj zzflj) throws IOException {
        int i;
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx == 10) {
                int zzb = zzflv.zzb(zzflj, 10);
                int length = this.zzpyk == null ? 0 : this.zzpyk.length;
                String[] strArr = new String[(zzb + length)];
                if (length != 0) {
                    System.arraycopy(this.zzpyk, 0, strArr, 0, length);
                }
                while (length < strArr.length - 1) {
                    strArr[length] = zzflj.readString();
                    zzflj.zzcxx();
                    length++;
                }
                strArr[length] = zzflj.readString();
                this.zzpyk = strArr;
            } else if (zzcxx == 18) {
                int zzb2 = zzflv.zzb(zzflj, 18);
                int length2 = this.zzpyl == null ? 0 : this.zzpyl.length;
                String[] strArr2 = new String[(zzb2 + length2)];
                if (length2 != 0) {
                    System.arraycopy(this.zzpyl, 0, strArr2, 0, length2);
                }
                while (length2 < strArr2.length - 1) {
                    strArr2[length2] = zzflj.readString();
                    zzflj.zzcxx();
                    length2++;
                }
                strArr2[length2] = zzflj.readString();
                this.zzpyl = strArr2;
            } else if (zzcxx != 24) {
                if (zzcxx == 26) {
                    i = zzflj.zzli(zzflj.zzcym());
                    int position = zzflj.getPosition();
                    int i2 = 0;
                    while (zzflj.zzcyo() > 0) {
                        zzflj.zzcya();
                        i2++;
                    }
                    zzflj.zzmw(position);
                    int length3 = this.zzpym == null ? 0 : this.zzpym.length;
                    int[] iArr = new int[(i2 + length3)];
                    if (length3 != 0) {
                        System.arraycopy(this.zzpym, 0, iArr, 0, length3);
                    }
                    while (length3 < iArr.length) {
                        iArr[length3] = zzflj.zzcya();
                        length3++;
                    }
                    this.zzpym = iArr;
                } else if (zzcxx == 32) {
                    int zzb3 = zzflv.zzb(zzflj, 32);
                    int length4 = this.zzpyn == null ? 0 : this.zzpyn.length;
                    long[] jArr = new long[(zzb3 + length4)];
                    if (length4 != 0) {
                        System.arraycopy(this.zzpyn, 0, jArr, 0, length4);
                    }
                    while (length4 < jArr.length - 1) {
                        jArr[length4] = zzflj.zzcxz();
                        zzflj.zzcxx();
                        length4++;
                    }
                    jArr[length4] = zzflj.zzcxz();
                    this.zzpyn = jArr;
                } else if (zzcxx == 34) {
                    i = zzflj.zzli(zzflj.zzcym());
                    int position2 = zzflj.getPosition();
                    int i3 = 0;
                    while (zzflj.zzcyo() > 0) {
                        zzflj.zzcxz();
                        i3++;
                    }
                    zzflj.zzmw(position2);
                    int length5 = this.zzpyn == null ? 0 : this.zzpyn.length;
                    long[] jArr2 = new long[(i3 + length5)];
                    if (length5 != 0) {
                        System.arraycopy(this.zzpyn, 0, jArr2, 0, length5);
                    }
                    while (length5 < jArr2.length) {
                        jArr2[length5] = zzflj.zzcxz();
                        length5++;
                    }
                    this.zzpyn = jArr2;
                } else if (zzcxx == 40) {
                    int zzb4 = zzflv.zzb(zzflj, 40);
                    int length6 = this.zzpyo == null ? 0 : this.zzpyo.length;
                    long[] jArr3 = new long[(zzb4 + length6)];
                    if (length6 != 0) {
                        System.arraycopy(this.zzpyo, 0, jArr3, 0, length6);
                    }
                    while (length6 < jArr3.length - 1) {
                        jArr3[length6] = zzflj.zzcxz();
                        zzflj.zzcxx();
                        length6++;
                    }
                    jArr3[length6] = zzflj.zzcxz();
                    this.zzpyo = jArr3;
                } else if (zzcxx == 42) {
                    i = zzflj.zzli(zzflj.zzcym());
                    int position3 = zzflj.getPosition();
                    int i4 = 0;
                    while (zzflj.zzcyo() > 0) {
                        zzflj.zzcxz();
                        i4++;
                    }
                    zzflj.zzmw(position3);
                    int length7 = this.zzpyo == null ? 0 : this.zzpyo.length;
                    long[] jArr4 = new long[(i4 + length7)];
                    if (length7 != 0) {
                        System.arraycopy(this.zzpyo, 0, jArr4, 0, length7);
                    }
                    while (length7 < jArr4.length) {
                        jArr4[length7] = zzflj.zzcxz();
                        length7++;
                    }
                    this.zzpyo = jArr4;
                } else if (!super.zza(zzflj, zzcxx)) {
                    return this;
                }
                zzflj.zzlj(i);
            } else {
                int zzb5 = zzflv.zzb(zzflj, 24);
                int length8 = this.zzpym == null ? 0 : this.zzpym.length;
                int[] iArr2 = new int[(zzb5 + length8)];
                if (length8 != 0) {
                    System.arraycopy(this.zzpym, 0, iArr2, 0, length8);
                }
                while (length8 < iArr2.length - 1) {
                    iArr2[length8] = zzflj.zzcya();
                    zzflj.zzcxx();
                    length8++;
                }
                iArr2[length8] = zzflj.zzcya();
                this.zzpym = iArr2;
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzpyk != null && this.zzpyk.length > 0) {
            for (String str : this.zzpyk) {
                if (str != null) {
                    zzflk.zzp(1, str);
                }
            }
        }
        if (this.zzpyl != null && this.zzpyl.length > 0) {
            for (String str2 : this.zzpyl) {
                if (str2 != null) {
                    zzflk.zzp(2, str2);
                }
            }
        }
        if (this.zzpym != null && this.zzpym.length > 0) {
            for (int zzad : this.zzpym) {
                zzflk.zzad(3, zzad);
            }
        }
        if (this.zzpyn != null && this.zzpyn.length > 0) {
            for (long zzf : this.zzpyn) {
                zzflk.zzf(4, zzf);
            }
        }
        if (this.zzpyo != null && this.zzpyo.length > 0) {
            for (long zzf2 : this.zzpyo) {
                zzflk.zzf(5, zzf2);
            }
        }
        super.zza(zzflk);
    }

    public final /* synthetic */ zzflm zzdck() throws CloneNotSupportedException {
        return (zzfmo) clone();
    }

    public final /* synthetic */ zzfls zzdcl() throws CloneNotSupportedException {
        return (zzfmo) clone();
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzpyk != null && this.zzpyk.length > 0) {
            int i = 0;
            int i2 = 0;
            for (String str : this.zzpyk) {
                if (str != null) {
                    i2++;
                    i += zzflk.zztx(str);
                }
            }
            zzq = zzq + i + (i2 * 1);
        }
        if (this.zzpyl != null && this.zzpyl.length > 0) {
            int i3 = 0;
            int i4 = 0;
            for (String str2 : this.zzpyl) {
                if (str2 != null) {
                    i4++;
                    i3 += zzflk.zztx(str2);
                }
            }
            zzq = zzq + i3 + (i4 * 1);
        }
        if (this.zzpym != null && this.zzpym.length > 0) {
            int i5 = 0;
            for (int zzlx : this.zzpym) {
                i5 += zzflk.zzlx(zzlx);
            }
            zzq = zzq + i5 + (this.zzpym.length * 1);
        }
        if (this.zzpyn != null && this.zzpyn.length > 0) {
            int i6 = 0;
            for (long zzdj : this.zzpyn) {
                i6 += zzflk.zzdj(zzdj);
            }
            zzq = zzq + i6 + (this.zzpyn.length * 1);
        }
        if (this.zzpyo == null || this.zzpyo.length <= 0) {
            return zzq;
        }
        int i7 = 0;
        for (long zzdj2 : this.zzpyo) {
            i7 += zzflk.zzdj(zzdj2);
        }
        return zzq + i7 + (1 * this.zzpyo.length);
    }
}
